package com.hl.service.serviceImpl;

import com.hl.domain.Psychologyknowledge;
import com.hl.mapper.PsychologyknowledgeMapper;
import com.hl.service.PsychologyKnowledgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PsychologyKnowledgeServiceImpl implements PsychologyKnowledgeService {

    @Autowired
    private PsychologyknowledgeMapper psychologyknowledgeMapper;

//    查询所有
    @Override
    public List<Psychologyknowledge> selectAll() {
        return psychologyknowledgeMapper.selectAll();
    }

//    根据name查询
    @Override
    public Psychologyknowledge selectByPsychologyname(String name) {
        return psychologyknowledgeMapper.selectByPsychologyname(name);
    }

    @Override
    public Psychologyknowledge selectByPrimaryKey(Long id) {
        return psychologyknowledgeMapper.selectByPrimaryKey(id);
    }


    //    新增
    @Override
    public int insert(Psychologyknowledge psychologyknowledge) {
        return psychologyknowledgeMapper.insert(psychologyknowledge);
    }

//    删除
    @Override
    public int delete(Long id) {
        return psychologyknowledgeMapper.deleteByPrimaryKey(id);
    }

//    修改
    @Override
    public int update(Psychologyknowledge psychologyknowledge) {
        return psychologyknowledgeMapper.updateByPrimaryKey(psychologyknowledge);
    }










}
